#include "Tlc5940.h"
#include "LEDControl.h"
cLED LEDs[10];

void setup() {
  Serial.begin(19200);
  Serial.println("Hello");
  
  //setupColrtest();
  Tlc.init();
  for (int x=0;x<32;x+=3)
  {
    if(x==15){x++;}
    LEDs[x/3].init(x,x+2,x+1);
  }
  
}

void loop() {
  serial();
  Tlc.update();
  heartbeat();
}

uint8_t hbval=128;
int8_t hbdelta=8;
void heartbeat() {
  if (hbval > 192) hbdelta = -hbdelta;
  if (hbval < 32) hbdelta = -hbdelta;
  hbval += hbdelta;
  analogWrite(12, hbval);
  delay(40);
}
